{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {
    "toc": true
   },
   "source": [
    "<h1>大纲<span class=\"tocSkip\"></span></h1>\n",
    "<div class=\"toc\"><ul class=\"toc-item\"></ul></div>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-06-03T02:15:35.394852Z",
     "start_time": "2018-06-03T02:15:35.384724Z"
    }
   },
   "outputs": [],
   "source": [
    "# Run this cell but don't modify it.\n",
    "\n",
    "%load_ext autoreload\n",
    "%autoreload 2\n",
    "from matrix import Matrix, zeroes, identity"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-06-03T02:15:35.408744Z",
     "start_time": "2018-06-03T02:15:35.396269Z"
    }
   },
   "outputs": [],
   "source": [
    "# some functionality already exists... here's a demo\n",
    "\n",
    "m1 = Matrix([\n",
    "    [1, 2],\n",
    "    [3, 4]\n",
    "])\n",
    "\n",
    "m2 = Matrix([\n",
    "    [2, 5],\n",
    "    [6, 1]\n",
    "])\n",
    "\n",
    "print(\"m1 is\")\n",
    "print(m1)\n",
    "\n",
    "print(\"m2 is\")\n",
    "print(m2)\n",
    "\n",
    "print(\"we've also provided you with a function called zeros\")\n",
    "print(\"here's what happens when you call zeros(4,2)\")\n",
    "print(zeroes(4,2))\n",
    "\n",
    "print(\"we've also provided you with a function called identity\")\n",
    "print(\"here's identity(3)\")\n",
    "print(identity(3))\n",
    "\n",
    "print(\"but not everything works yet!\")\n",
    "print(\"for example, matrix addition...\")\n",
    "print(\"run the cell below to see what happens when we try...\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-06-03T02:15:35.417781Z",
     "start_time": "2018-06-03T02:15:35.410452Z"
    }
   },
   "outputs": [],
   "source": [
    "m1 = Matrix([\n",
    "    [1, 2],\n",
    "    [3, 4]\n",
    "])\n",
    "\n",
    "m2 = Matrix([\n",
    "    [2, 5],\n",
    "    [6, 1]\n",
    "])\n",
    "\n",
    "m3 = m1 + m2\n",
    "print(\"m1 + m2 is\")\n",
    "print(m3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-06-03T07:54:34.849247Z",
     "start_time": "2018-06-03T07:54:34.841440Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Congratulations! All tests pass. Your Matrix class is working as expected.\n"
     ]
    }
   ],
   "source": [
    "# Try running this code. You should get an assertion error. \n",
    "# You will continue to get assertion errors until all the \n",
    "# methods in matrix.py are correctly implemented.\n",
    "\n",
    "# You can open matrix.py by selecting File > Open... \n",
    "# and then selecting matrix.py\n",
    "\n",
    "import test"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# open matrix.py (File > Open...) and start\n",
    "# implementing matrix methods! \n",
    "\n",
    "# when your code passes all the tests you can submit by \n",
    "# pressing the SUBMIT button in the lower right corner \n",
    "# of this page."
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.4"
  },
  "toc": {
   "base_numbering": 1.0,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "大纲",
   "title_sidebar": "目录",
   "toc_cell": true,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": true
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
